const mongoose = require("mongoose")
mongoose.connect("mongodb://127.0.0.1/mongoose_test")
const Schema = mongoose.Schema
const studentsSchema = new Schema({
    name: String,
    age: {
        type: Number,
        min: 10,
        max: 50,
        required: true,
    },
    gender: {
        type: String,
        default: "male",

    }
})
const StudentsModel = mongoose.model("students", studentsSchema)
let studentsDoc = new StudentsModel({
    name: "lz",
    age: 18,
    gender: "female"
})
studentsDoc.address = "cz"
studentsDoc.save()